package com.jnu.hc.jnuhcusercms.mapper;

import com.jnu.hc.jnuhcusercms.domain.Checkitemdetailed;
import com.jnu.hc.jnuhcusercms.domain.Cidetailedreport;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CheckitemdetailedMapper {
    int deleteByPrimaryKey(Integer cdId);

    int insert(Checkitemdetailed record);

    int insertSelective(Checkitemdetailed record);

    Checkitemdetailed selectByPrimaryKey(Integer cdId);

    @Select("SELECT cd.cdId, cd.name, cd.unit, \n" +
            "      cd.minrange, cd.maxrange, cd.normalValue, \n" +
            "      cd.normalValueString, cd.type, cd.ciId\n" +
            "FROM setmeal s,setmealdetailed sd,checkitem c,checkitemdetailed cd\n" +
            "WHERE s.smId=sd.smId AND sd.ciId=c.ciId AND c.ciId=cd.ciId AND s.smId=#{smId}")
    List<Cidetailedreport> selectBySmId(Integer smId);

    int updateByPrimaryKeySelective(Checkitemdetailed record);

    int updateByPrimaryKey(Checkitemdetailed record);
}